<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<div id="app">
    {{msg}}
    <hr>
    <input type="text" v-model="tex">
    <button @click="send">发送语音</button> <audio src="" autoplay controls></audio>




</div>
<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.7.14/vue.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>

<script>
    const vu = new Vue({
        el: "#app",
        data: {
            msg: 'hello vue',
            tex: ''

        },
        methods: {
            async send() {
                console.log('123')
                const res = await axios({
                    url: 'http://ajax-api.itheima.net/api/robot',
                    params: {
                        spoken: this.tex
                    }
                })

                console.log(res.data.data.info)
                    // const res1 = await axios({
                    //     url: 'http://ajax-base-api-t.itheima.net/api/synthesize',
                    //     params: {
                    //         text: res.data.data.info.tex
                    //     }
                    // })
                    // console.log(res1)
            }

        },
        computed: {

        }
    })
</script>






</body>

</html>